package chapter12

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/20 19:34
  * @history:
  *          1.2019/1/20 created by chuhaitao
  */
object VarMatchDemo {


  def main(args: Array[String]): Unit = {
    var (x,y)=(1,2)
    println(x+";"+y)

    var (q,t)=BigInt(100)/%3//说明：BigInt(100)/3 付给变量q  BigInt(100)%3付给变量t
    println(q+";"+t)

    var arr=Array(1,2,23,12321)
    var Array(fist,sencond,_*)=arr
    println(fist+";"+sencond)


    val map =Map(1->2,1->0,"a"->0)


    for((k,v)<-map){
      println(k+";"+v)
    }

    for((k,0)<-map){
      println(k+";")
    }

    for((k,v)<-map if v == 0){
      println(k+";")
    }
  }
}
